home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / webbrwsr / nsIWebBrowser.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  12KB  |  274 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIWebBrowser.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIWebBrowser_h__
  6. #define __gen_nsIWebBrowser_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIInterfaceRequestor; /* forward declaration */
  18.  
  19. class nsIWebBrowserChrome; /* forward declaration */
  20.  
  21. class nsIURIContentListener; /* forward declaration */
  22.  
  23. class nsIDOMWindow; /* forward declaration */
  24.  
  25. class nsIWeakReference; /* forward declaration */
  26.  
  27.  
  28. /* starting interface:    nsIWebBrowser */
  29. #define NS_IWEBBROWSER_IID_STR "69e5df00-7b8b-11d3-af61-00a024ffc08c"
  30.  
  31. #define NS_IWEBBROWSER_IID \
  32.   {0x69e5df00, 0x7b8b, 0x11d3, \
  33.     { 0xaf, 0x61, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
  34.  
  35. /**
  36.  * The nsIWebBrowser interface is implemented by web browser objects.
  37.  * Embedders use this interface during initialisation to associate
  38.  * the new web browser instance with the embedders chrome and
  39.  * to register any listeners. The interface may also be used at runtime
  40.  * to obtain the content DOM window and from that the rest of the DOM.
  41.  *
  42.  * @status FROZEN
  43.  */
  44. class NS_NO_VTABLE nsIWebBrowser : public nsISupports {
  45.  public: 
  46.  
  47.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBBROWSER_IID)
  48.  
  49.   /**
  50.      * Registers a listener of the type specified by the iid to receive
  51.      * callbacks. The browser stores a weak reference to the listener
  52.      * to avoid any circular dependencies.
  53.      * Typically this method will be called to register an object
  54.      * to receive <CODE>nsIWebProgressListener</CODE> or 
  55.      * <CODE>nsISHistoryListener</CODE> notifications in which case the
  56.      * the IID is that of the interface.
  57.      *
  58.      * @param aListener The listener to be added.
  59.      * @param aIID      The IID of the interface that will be called
  60.      *                  on the listener as appropriate.
  61.      * @return          <CODE>NS_OK</CODE> for successful registration;
  62.      *                  <CODE>NS_ERROR_INVALID_ARG</CODE> if aIID is not
  63.      *                  supposed to be registered using this method;
  64.      *                  <CODE>NS_ERROR_FAILURE</CODE> either aListener did not
  65.      *                  expose the interface specified by the IID, or some
  66.      *                  other internal error occurred.
  67.      *
  68.      * @see removeWebBrowserListener
  69.      * @see nsIWeakReference
  70.      * @see nsIWebProgressListener
  71.      * @see nsISHistoryListener
  72.      *
  73.      * @return <CODE>NS_OK</CODE>, listener was successfully added;
  74.      *         <CODE>NS_ERROR_INVALID_ARG</CODE>, one of the arguments was
  75.      *         invalid or the object did not implement the interface
  76.      *         specified by the IID.
  77.      */
  78.   /* void addWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  79.   NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) = 0;
  80.  
  81.   /**
  82.      * Removes a previously registered listener.
  83.      *
  84.      * @param aListener The listener to be removed.
  85.      * @param aIID      The IID of the interface on the listener that will
  86.      *                  no longer be called.
  87.      *
  88.      * @return <CODE>NS_OK</CODE>, listener was successfully removed;
  89.      *         <CODE>NS_ERROR_INVALID_ARG</CODE> arguments was invalid or
  90.      *         the object did not implement the interface specified by the IID.
  91.      *
  92.      * @see addWebBrowserListener
  93.      * @see nsIWeakReference
  94.      */
  95.   /* void removeWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  96.   NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) = 0;
  97.  
  98.   /**
  99.      * The chrome object associated with the browser instance. The embedder
  100.      * must create one chrome object for <I>each</I> browser object
  101.      * that is instantiated. The embedder must associate the two by setting
  102.      * this property to point to the chrome object before creating the browser
  103.      * window via the browser's <CODE>nsIBaseWindow</CODE> interface. 
  104.      *
  105.      * The chrome object must also implement <CODE>nsIEmbeddingSiteWindow</CODE>.
  106.      *
  107.      * The chrome may optionally implement <CODE>nsIInterfaceRequestor</CODE>,
  108.      * <CODE>nsIWebBrowserChromeFocus</CODE>,
  109.      * <CODE>nsIContextMenuListener</CODE> and
  110.      * <CODE>nsITooltipListener</CODE> to receive additional notifications
  111.      * from the browser object.
  112.      *
  113.      * The chrome object may optionally implement <CODE>nsIWebProgressListener</CODE> 
  114.      * instead of explicitly calling <CODE>addWebBrowserListener</CODE> and
  115.      * <CODE>removeWebBrowserListener</CODE> to register a progress listener
  116.      * object. If the implementation does this, it must also implement
  117.      * <CODE>nsIWeakReference</CODE>.
  118.      * 
  119.      * @note The implementation should not refcount the supplied chrome
  120.      *       object; it should assume that a non <CODE>nsnull</CODE> value is
  121.      *       always valid. The embedder must explicitly set this value back
  122.      *       to nsnull if the chrome object is destroyed before the browser
  123.      *       object.
  124.      *
  125.      * @see nsIBaseWindow
  126.      * @see nsIWebBrowserChrome
  127.      * @see nsIEmbeddingSiteWindow
  128.      * @see nsIInterfaceRequestor
  129.      * @see nsIWebBrowserChromeFocus
  130.      * @see nsIContextMenuListener
  131.      * @see nsITooltipListener
  132.      * @see nsIWeakReference
  133.      * @see nsIWebProgressListener
  134.      */
  135.   /* attribute nsIWebBrowserChrome containerWindow; */
  136.   NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow) = 0;
  137.   NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow) = 0;
  138.  
  139.   /**
  140.      * URI content listener parent. The embedder may set this property to
  141.      * their own implementation if they intend to override or prevent
  142.      * how certain kinds of content are loaded.
  143.      *
  144.      * @note If this attribute is set to an object that implements
  145.      *       nsISupportsWeakReference, the implementation should get the
  146.      *       nsIWeakReference and hold that.  Otherwise, the implementation
  147.      *       should not refcount this interface; it should assume that a non
  148.      *       null value is always valid.  In that case, the embedder should
  149.      *       explicitly set this value back to null if the parent content
  150.      *       listener is destroyed before the browser object.
  151.      *
  152.      * @see nsIURIContentListener
  153.      */
  154.   /* attribute nsIURIContentListener parentURIContentListener; */
  155.   NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener) = 0;
  156.   NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener) = 0;
  157.  
  158.   /**
  159.      * The top-level DOM window. The embedder may walk the entire
  160.      * DOM starting from this value.
  161.      *
  162.      * @see nsIDOMWindow
  163.      */
  164.   /* readonly attribute nsIDOMWindow contentDOMWindow; */
  165.   NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) = 0;
  166.  
  167. };
  168.  
  169. /* Use this macro when declaring classes that implement this interface. */
  170. #define NS_DECL_NSIWEBBROWSER \
  171.   NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID); \
  172.   NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID); \
  173.   NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow); \
  174.   NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow); \
  175.   NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener); \
  176.   NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener); \
  177.   NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow); 
  178.  
  179. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  180. #define NS_FORWARD_NSIWEBBROWSER(_to) \
  181.   NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return _to AddWebBrowserListener(aListener, aIID); } \
  182.   NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return _to RemoveWebBrowserListener(aListener, aIID); } \
  183.   NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow) { return _to GetContainerWindow(aContainerWindow); } \
  184.   NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow) { return _to SetContainerWindow(aContainerWindow); } \
  185.   NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener) { return _to GetParentURIContentListener(aParentURIContentListener); } \
  186.   NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener) { return _to SetParentURIContentListener(aParentURIContentListener); } \
  187.   NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) { return _to GetContentDOMWindow(aContentDOMWindow); } 
  188.  
  189. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  190. #define NS_FORWARD_SAFE_NSIWEBBROWSER(_to) \
  191.   NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddWebBrowserListener(aListener, aIID); } \
  192.   NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveWebBrowserListener(aListener, aIID); } \
  193.   NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContainerWindow(aContainerWindow); } \
  194.   NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContainerWindow(aContainerWindow); } \
  195.   NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParentURIContentListener(aParentURIContentListener); } \
  196.   NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetParentURIContentListener(aParentURIContentListener); } \
  197.   NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentDOMWindow(aContentDOMWindow); } 
  198.  
  199. #if 0
  200. /* Use the code below as a template for the implementation class for this interface. */
  201.  
  202. /* Header file */
  203. class nsWebBrowser : public nsIWebBrowser
  204. {
  205. public:
  206.   NS_DECL_ISUPPORTS
  207.   NS_DECL_NSIWEBBROWSER
  208.  
  209.   nsWebBrowser();
  210.  
  211. private:
  212.   ~nsWebBrowser();
  213.  
  214. protected:
  215.   /* additional members */
  216. };
  217.  
  218. /* Implementation file */
  219. NS_IMPL_ISUPPORTS1(nsWebBrowser, nsIWebBrowser)
  220.  
  221. nsWebBrowser::nsWebBrowser()
  222. {
  223.   /* member initializers and constructor code */
  224. }
  225.  
  226. nsWebBrowser::~nsWebBrowser()
  227. {
  228.   /* destructor code */
  229. }
  230.  
  231. /* void addWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  232. NS_IMETHODIMP nsWebBrowser::AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID)
  233. {
  234.     return NS_ERROR_NOT_IMPLEMENTED;
  235. }
  236.  
  237. /* void removeWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  238. NS_IMETHODIMP nsWebBrowser::RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID)
  239. {
  240.     return NS_ERROR_NOT_IMPLEMENTED;
  241. }
  242.  
  243. /* attribute nsIWebBrowserChrome containerWindow; */
  244. NS_IMETHODIMP nsWebBrowser::GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow)
  245. {
  246.     return NS_ERROR_NOT_IMPLEMENTED;
  247. }
  248. NS_IMETHODIMP nsWebBrowser::SetContainerWindow(nsIWebBrowserChrome * aContainerWindow)
  249. {
  250.     return NS_ERROR_NOT_IMPLEMENTED;
  251. }
  252.  
  253. /* attribute nsIURIContentListener parentURIContentListener; */
  254. NS_IMETHODIMP nsWebBrowser::GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener)
  255. {
  256.     return NS_ERROR_NOT_IMPLEMENTED;
  257. }
  258. NS_IMETHODIMP nsWebBrowser::SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener)
  259. {
  260.     return NS_ERROR_NOT_IMPLEMENTED;
  261. }
  262.  
  263. /* readonly attribute nsIDOMWindow contentDOMWindow; */
  264. NS_IMETHODIMP nsWebBrowser::GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow)
  265. {
  266.     return NS_ERROR_NOT_IMPLEMENTED;
  267. }
  268.  
  269. /* End of implementation class template. */
  270. #endif
  271.  
  272.  
  273. #endif /* __gen_nsIWebBrowser_h__ */
  274.